package io;

import java.io.FileWriter;
import java.io.IOException;

import org.jdom.Document;
import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;

public class XMLWriter {

	 final String XML_PATH = System.getProperty("user.dir") + 
	                              "/data/";
	 
	 
	
	public void writeXml(Document document,String fileName){		 
		XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
		FileWriter writer;
		try {
			writer = new FileWriter(XML_PATH + fileName);
			outputter.output(document, writer);
	        writer.close();
		} catch (IOException e) {			
			e.printStackTrace();
		}        
	}
}
